package javaBase.javaIterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * Created by admin on 2017/2/28.
 */
public class TestIterator {
    public void testIterator() {
        ArrayList list = new ArrayList();
        list.add("1");
        list.add("2");
        list.add("3");
        Iterator i = list.iterator();
        while (i.hasNext()) {
            System.out.println(i.next());
        }
    }

    public static void main(String[] arge) {
        TestIterator ti = new TestIterator();
        ti.testIterator();
    }
}
